package com.whmall.service.crm.provider;

import com.whmall.service.crm.api.CompanyBusinessLicenseApi;
import com.whmall.service.crm.entity.dto.companybusinesslicense.BusinessLicenseQueryReqDTO;
import com.whmall.service.crm.entity.dto.companybusinesslicense.CompanyBusinessLicenseRspDTO;
import com.whmall.service.crm.entity.dto.companybusinesslicense.CreateCompanyBusinessLicenseReqDTO;
import com.whmall.service.crm.entity.dto.companybusinesslicense.UpdateCompanyBusinessLicenseReqDTO;
import com.whmall.service.crm.module.companybusinesslicense.service.CompanyBusinessLicenseService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;

/**
 * Author：yangdong
 * Date：2020/8/3
 * Description：营业执照API实现
 */
@Service(interfaceClass = CompanyBusinessLicenseApi.class)
public class CompanyBusinessLicenseProvider implements CompanyBusinessLicenseApi {

    @Autowired
    private CompanyBusinessLicenseService companyBusinessLicenseService;

    @Override
    public List<CompanyBusinessLicenseRspDTO> selectBy(BusinessLicenseQueryReqDTO queryReqDTO) {
        return companyBusinessLicenseService.selectBy(queryReqDTO);
    }

    @Override
    public CompanyBusinessLicenseRspDTO getById(Long id) {
        return companyBusinessLicenseService.getById(id);
    }

    @Override
    public int insert(CreateCompanyBusinessLicenseReqDTO createCompanyBusinessLicenseReqDTO) {
        return companyBusinessLicenseService.insert(createCompanyBusinessLicenseReqDTO);
    }

    @Override
    public int update(UpdateCompanyBusinessLicenseReqDTO updateCompanyBusinessLicenseReqDTO) {
        return companyBusinessLicenseService.update(updateCompanyBusinessLicenseReqDTO);
    }

    @Override
    public int countEffective(Long id, Long companyId, String socialCreditCode) {
        return companyBusinessLicenseService.countEffective(id, companyId, socialCreditCode);
    }

    @Override
    public void revalidateEffective() {
        companyBusinessLicenseService.revalidateEffective();
    }
}
